package com.southwind.mapper;

import com.southwind.entity.Car;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.southwind.entity.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-07-04
 */
public interface CarMapper extends BaseMapper<Car> {

    @Select({"select number from car where id = #{id} "})
    public String getCarNumberById(Integer id);

    @Select({"select * from car where id not in (select cid from user)"})
    public List<Car> listForUser();

    @Update({"update car set status = #{status} where id = #{id}"})
    public Integer updateStatus(String status,Integer id);

    @Select({"select * from car where status = '洗车完毕'"})
    public List<Car> listForWork();
}
